package org.xhystudy.rpc.tolerant;

import org.xhystudy.rpc.registry.loadbalancer.LoadBalancerType;

/**
 * @description:
 * @Author: Xhy
 * @gitee: https://gitee.com/XhyQAQ
 * @copyright: B站: https://space.bilibili.com/152686439
 * @CreateTime: 2023-05-03 21:16
 */
public enum FaultTolerantType {
    Failover,
    FailFast,
    Failsafe;

    public static FaultTolerantType toFaultTolerant(String loadBalancer){
        for (FaultTolerantType value : values()) {
            if (value.toString().equals(loadBalancer)) {
                return value;
            }
        }
        return null;
    }
}
